﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace Model
{
    [Serializable]
    public partial class Sys8a00
    {
		private string _popno;
		private string _ptable;
		private string _pkey;
		private string _fields;
        private int? _pagesize;
		private string _orderfid;
		private string _strwhere;
		private string _keyref;
		private string _reffield;
		private string _issavekey;
		private string _description;
        private int? _width;
        private int? _height;
		
        /// <summary>
        /// 弹出框IP
        /// </summary>
		public string Popno
		{
			get { return _popno;	 }
			set { _popno=value;	}
		}
        /// <summary>
        /// 表
        /// </summary>
		public string Ptable
		{
			get { return _ptable;	 }
			set { _ptable=value;	}
		}
        /// <summary>
        /// 主键
        /// </summary>
		public string Pkey
		{
			get { return _pkey;	 }
			set { _pkey=value;	}
		}
        /// <summary>
        /// 显示字段
        /// </summary>
		public string Fields
		{
			get { return _fields;	 }
			set { _fields=value;	}
		}
        /// <summary>
        /// 每页记录数
        /// </summary>
		public int? Pagesize
		{
			get { return _pagesize;	 }
			set { _pagesize=value;	}
		}
        /// <summary>
        /// 排序字段
        /// </summary>
		public string Orderfid
		{
			get { return _orderfid;	 }
			set { _orderfid=value;	}
		}
        /// <summary>
        /// 条件
        /// </summary>
		public string Strwhere
		{
			get { return _strwhere;	 }
			set { _strwhere=value;	}
		}
        /// <summary>
        /// 主键列回传
        /// </summary>
		public string Keyref
		{
			get { return _keyref;	 }
			set { _keyref=value;	}
		}
        /// <summary>
        /// 相关回传列
        /// </summary>
		public string Reffield
		{
			get { return _reffield;	 }
			set { _reffield=value;	}
		}
        /// <summary>
        /// 是否保存主键(F)
        /// </summary>
		public string Issavekey
		{
			get { return _issavekey;	 }
			set { _issavekey=value;	}
		}
        /// <summary>
        /// 描述
        /// </summary>
		public string Description
		{
			get { return _description;	 }
			set { _description=value;	}
		}
        /// <summary>
        /// 宽度
        /// </summary>
		public int? Width
		{
			get { return _width;	 }
			set { _width=value;	}
		}
        /// <summary>
        /// 高度
        /// </summary>
		public int? Height
		{
			get { return _height;	 }
			set { _height=value;	}
		}
		
		public static List<Sys8a00> GetSys8a00ListByDataTable(DataTable dt)
		{
			if(dt == null) return null;
		    List<Sys8a00> list = new List<Sys8a00>();
		   
			foreach(DataRow dr in dt.Rows)
            {
				Sys8a00 model = GetSys8a00ByDataRow(dr);
				if(null == model) continue;
				
				list.Add(model);
            }
           return list;
		}
		
		public static Sys8a00 GetSys8a00ByDataRow(DataRow dr)
		{
			Sys8a00 model = new Sys8a00(); //实例化Sys8a00
	
			DataColumnCollection dcc = dr.Table.Columns;

			if (dcc.Contains("popno")&&!(dr["popno"] is System.DBNull))  
				model.Popno = ( string)dr["popno"];
			if (dcc.Contains("ptable")&&!(dr["ptable"] is System.DBNull))  
				model.Ptable = ( string)dr["ptable"];
			if (dcc.Contains("pkey")&&!(dr["pkey"] is System.DBNull))  
				model.Pkey = ( string)dr["pkey"];
			if (dcc.Contains("fields")&&!(dr["fields"] is System.DBNull))  
				model.Fields = ( string)dr["fields"];
			if (dcc.Contains("pagesize")&&!(dr["pagesize"] is System.DBNull))  
				model.Pagesize = ( int)dr["pagesize"];
			if (dcc.Contains("orderfid")&&!(dr["orderfid"] is System.DBNull))  
				model.Orderfid = ( string)dr["orderfid"];
			if (dcc.Contains("strwhere")&&!(dr["strwhere"] is System.DBNull))  
				model.Strwhere = ( string)dr["strwhere"];
			if (dcc.Contains("keyref")&&!(dr["keyref"] is System.DBNull))  
				model.Keyref = ( string)dr["keyref"];
			if (dcc.Contains("reffield")&&!(dr["reffield"] is System.DBNull))  
				model.Reffield = ( string)dr["reffield"];
			if (dcc.Contains("issavekey")&&!(dr["issavekey"] is System.DBNull))  
				model.Issavekey = ( string)dr["issavekey"];
			if (dcc.Contains("description")&&!(dr["description"] is System.DBNull))  
				model.Description = ( string)dr["description"];
			if (dcc.Contains("width")&&!(dr["width"] is System.DBNull))  
				model.Width = ( int)dr["width"];
			if (dcc.Contains("height")&&!(dr["height"] is System.DBNull))  
				model.Height = ( int)dr["height"];
			
			return model;
		}
    }
}
